<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	<ui:param name="pageName" value="Approve Misc Expense"></ui:param>
	<ui:define name="sidebar">
	<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
	
		<h:form>
		    <h:outputText value="Miscellaneous Expense Requests" styleClass="outputTextTitle"/>
		<p:growl />
			
			<p:tabView id="tabView" > 
				
				<p:tab id="tab1" title="Inprocess" >  
					
				  <p:dataTable value="#{inprocessMiscllaneousExpensesBean.miscExpenseInprocessList}" var="miscExpense" paginator="true" rows="25">  
	  
		           <p:column headerText="S.No"> 
		                <h:outputText value="#{miscExpense.sNo}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{miscExpense.employee.firstName} #{miscExpense.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Request Date">
							<h:outputText value="#{miscExpense.requestDate}">
								<f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{inprocessMiscllaneousExpensesBean.timeZone}"/>
							</h:outputText>
					</p:column>
		            
		            <p:column headerText="Expense Code">
		                <h:outputText value="#{miscExpense.miscExpenseCode}" />  
		            </p:column>  
		            
		            <p:column headerText="Purpose">
		                <h:outputText value="#{miscExpense.briefPurposeDetails}" />
	                	<h:outputText id="imore" value="more" style="float: right; color: #EAAB00;  cursor: pointer;"/>
		                
		                <p:tooltip for="imore">
		                	<h:panelGrid columnClasses="gridCellMiddleLeftAligned" style="width: 200px;">
		                		<h:outputText value="Purpose of expense" style="font-weight: bold;"/>
		                		<h:outputText value="#{miscExpense.expensePurpose}" />
		                	</h:panelGrid>
		                </p:tooltip>  
		            </p:column> 
		            
		            <p:column headerText="Status">
		                <h:outputText value="#{miscExpense.expenseStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approve">
		                <p:commandButton action="#{inprocessMiscllaneousExpensesBean.miscExpenseApprovedAction}" value="Approve" >			
							<f:param id="miscCode" name="miscCode" value="#{miscExpense.miscExpenseCode}" />
							<f:param id="empId" name="empId" value="#{miscExpense.employee.employeeId}" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
				
				<p:tab id="tab2" title="Approved" >  
					
				  <p:dataTable paginator="true" rows="25" value="#{inprocessMiscllaneousExpensesBean.miscExpenseApprovedList}" var="miscExpense" >  
	  
		           <p:column headerText="S.No"> 
		                <h:outputText value="#{miscExpense.sNo}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{miscExpense.employee.firstName} #{miscExpense.employee.lastName}" />  
		            </p:column> 
		            
		             <p:column headerText="Request Date">
							<h:outputText value="#{miscExpense.requestDate}">
								<f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{inprocessMiscllaneousExpensesBean.timeZone}"/>
							</h:outputText>
					</p:column>
		            
		            <p:column headerText="Expense Code">
		                <h:outputText value="#{miscExpense.miscExpenseCode}" />  
		            </p:column>  
		            
		            <p:column headerText="Purpose">
		                <h:outputText value="#{miscExpense.briefPurposeDetails}" />
	                	<h:outputText id="amore" value="more" style="float: right;color: #EAAB00;  cursor: pointer;"/>
		                
		                <p:tooltip for="amore">
		                	<h:panelGrid columnClasses="gridCellMiddleLeftAligned" style="width: 200px;">
		                		<h:outputText value="Purpose of expense" style="font-weight: bold;"/>
		                		<h:outputText value="#{miscExpense.expensePurpose}" />
		                	</h:panelGrid>
		                </p:tooltip>  
		            </p:column> 
		            
		            <p:column headerText="Status">
		                <h:outputText value="#{miscExpense.expenseStatus}" />
		            </p:column> 
		            
		            <p:column headerText="View">
		                <p:commandButton action="#{inprocessMiscllaneousExpensesBean.miscExpenseApprovedAction}" value="View" >			
							<f:param id="miscCode" name="miscCode" value="#{miscExpense.miscExpenseCode}" />
							<f:param id="empId" name="empId" value="#{miscExpense.employee.employeeId}" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
				
				<p:tab id="tab3" title="Rejected" >  
					
				  <p:dataTable paginator="true" rows="25" value="#{inprocessMiscllaneousExpensesBean.miscExpenseRejectedList}" var="miscExpense" >  
	  
		           <p:column headerText="S.No"> 
		                <h:outputText value="#{miscExpense.sNo}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{miscExpense.employee.firstName} #{miscExpense.employee.lastName}" />  
		            </p:column> 
		            
		             <p:column headerText="Request Date">
							<h:outputText value="#{miscExpense.requestDate}">
								<f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{inprocessMiscllaneousExpensesBean.timeZone}"/>
							</h:outputText>
					 </p:column>
		            
		            <p:column headerText="Expense Code">
		                <h:outputText value="#{miscExpense.miscExpenseCode}" />  
		            </p:column> 
		            
		            <p:column headerText="Purpose">		                
	                	<h:outputText value="#{miscExpense.briefPurposeDetails}" />
	                	<h:outputText id="rmore" value="more" style="float: right; color: #EAAB00; cursor: pointer;"/>
		                <p:tooltip for="rmore">
		                	<h:panelGrid columnClasses="gridCellMiddleLeftAligned" style="width: 200px;">
		                		<h:outputText value="Purpose of expense" style="font-weight: bold;"/>
		                		<h:outputText value="#{miscExpense.expensePurpose}" />
		                	</h:panelGrid>
		                </p:tooltip>  
		            </p:column>  
		            
		            <p:column headerText="Status">
		                <h:outputText value="#{miscExpense.expenseStatus}" />
		            </p:column> 
		            
		            <p:column headerText="View">
		                <p:commandButton action="#{inprocessMiscllaneousExpensesBean.miscExpenseApprovedAction}" value="View" >			
							<f:param id="miscCode" name="miscCode" value="#{miscExpense.miscExpenseCode}" />
							<f:param id="empId" name="empId" value="#{miscExpense.employee.employeeId}" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
			
			</p:tabView>
			
		</h:form>
	</ui:define>
</ui:composition>

